class Solution(object):
    def jump(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        L = len(nums)
        ans = 0
        max_i = 0
        start = 0
        end = 1
        #每次在start,end间起跳
        while end < L:
            for j in range(start, end):
                max_i = max(max_i, j + nums[j])
            start = end
            end = max_i + 1
            ans = ans + 1
        return ans
